{extend name="Layout/datagrid" /}
{block name="content_header"}        
<h1>
    网站设置
    <small>advanced tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">系统</a></li>
    <li class="active">网站设置</li>
</ol>
{/block}
{block name="content"}
<div class="box">
    <div class="box-header">
        <ul class="nav nav-tabs">
            {foreach name="tabs" item="vo"}
            <li class="{$vo.active}"><a href="{:U($vo['url'])}">{$vo.title}</a></li>
            {/foreach}
        </ul>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
            <div class="col-md-5">
                <!-- form start -->
                <form action="{:U('editSave')}" method="post" enctype="multipart/form-data" class="form-horizontal">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">站点口号</label>
                            <div class="col-sm-9">
                                <input type="text" name="site_slogan" class="form-control input-sm" placeholder="站点口号" value="{$data.site_slogan}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">默认关键词</label>
                            <div class="col-sm-9">
                                <input type="text" name="meta_keywords" class="form-control input-sm" placeholder="默认关键词(关键词以空格隔开，最好10个以下，搜索引擎将忽略过多的关键词)" value="{$data.meta_keywords}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">首页关键词</label>
                            <div class="col-sm-9">
                                <input type="text" name="meta_keywords_index" class="form-control input-sm" placeholder="首页关键词" value="{$data.meta_keywords_index}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">站点描述</label>
                            <div class="col-sm-9">
                                <textarea name="meta_description" class="form-control input-sm" placeholder='站点描述 <meta name="description" content="" />(140-200个字符或者100个左右的汉字)' cols="90" rows="6">{$data.meta_description}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">Meta 标签</label>
                            <div class="col-sm-9">
                                <textarea name="meta_tags" class="form-control input-sm" placeholder="可放置<meta><script><style>和<link>标签" cols="90" rows="6">{$data.meta_tags}</textarea>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
                        <button type="submit" class="btn btn-primary pull-right">保存</button>
                    </div>
                    <!-- /.box-footer -->
                    <input type="hidden" name="id" value="{$data.id}"/>
                </form>
            </div>
        </div>
    </div>
    {/block}
    {block name="script_after"}
    <script>
        $(function () {
            $('.xsui-tabs a').click(function () {
                toggle_fields($(this).attr('href').substring(1));
                $('.xsui-tabs li').removeClass('ui-state-active').addClass('ui-state-default');
                $(this).parent().removeClass('ui-state-default').addClass('ui-state-active');
            })
            toggle_fields('B');
        })
        // 切换字段 2015-11-7 SoChishun Added.
        function toggle_fields(group) {
            $('.xsui-form-field').hide();
            $('.xsui-form-field[data-group="' + group + '"]').show();
        }
    </script>
    {/block}